package com.wanxi.util;

import java.util.Arrays;

public class PrintArr {
    public static void main(String[] args) {
        int[] arr = {11, 22, 4, 4, 6};
//        arr=null;
        System.out.println(Arrays.toString(arr));
        StringBuilder str= new StringBuilder("[");
        for (int i = 0; i < arr.length; i++) {
            if(i==arr.length-1){
                str.append(arr[i]);
            }else {
                str.append(arr[i]).append(", ");
            }
        }
        str.append("]");
        System.out.print(str);
    }
}
